import qs from 'qs';
import axios from 'axios';
import Vue from "vue";
Vue.prototype.$axios = axios;
// axios接口调用
export default function myAxios(url,type,data) {
  const https = "http://take.zhitiaoxiaoyuan.com/";
  console.log(url,type,data);
  var http = https+url;
  switch (type) {
    case 'get':
      return this.$axios.get(http,{
        params:data
      });
      break;
    case 'post':
      return this.$axios.post(http,qs.stringify(data));
      break;
  }
}

